package com.trkj.pojo;

import java.io.Serializable;
import javax.persistence.*;

import com.alibaba.fastjson.annotation.JSONField;

import java.sql.Timestamp;
import java.util.List;


/**
 * The persistent class for the SOCIAL_RELATIONS database table.
 * 
 */
@Entity
@Table(name="SOCIAL_RELATIONS")
@NamedQuery(name="SocialRelation.findAll", query="SELECT s FROM SocialRelation s")
public class SocialRelation implements Serializable {
	private static final long serialVersionUID = 1L;

	@Id
	@SequenceGenerator(name="SOCIAL_RELATIONS_SOCIID_GENERATOR", sequenceName="HR")
	@GeneratedValue(strategy=GenerationType.SEQUENCE, generator="SOCIAL_RELATIONS_SOCIID_GENERATOR")
	@Column(name="SOCI_ID")
	private long sociId;

	@Column(name="SOCI_CREATORDATE")
	private Timestamp sociCreatordate;

	@Column(name="SOCI_NAME")
	private String sociName;

	@Column(name="SOCI_PERSON")
	private String sociPerson;

	@Column(name="SOCI_UPDATEDATE")
	private Timestamp sociUpdatedate;

	//bi-directional many-to-one association to StaffInformation
	@OneToMany(mappedBy="socialRelation")
	@JSONField(serialize=false)
	private List<StaffInformation> staffInformations;

	public SocialRelation() {
	}

	public long getSociId() {
		return this.sociId;
	}

	public void setSociId(long sociId) {
		this.sociId = sociId;
	}

	public Timestamp getSociCreatordate() {
		return this.sociCreatordate;
	}

	public void setSociCreatordate(Timestamp sociCreatordate) {
		this.sociCreatordate = sociCreatordate;
	}

	public String getSociName() {
		return this.sociName;
	}

	public void setSociName(String sociName) {
		this.sociName = sociName;
	}

	public String getSociPerson() {
		return this.sociPerson;
	}

	public void setSociPerson(String sociPerson) {
		this.sociPerson = sociPerson;
	}

	public Timestamp getSociUpdatedate() {
		return this.sociUpdatedate;
	}

	public void setSociUpdatedate(Timestamp sociUpdatedate) {
		this.sociUpdatedate = sociUpdatedate;
	}

	public List<StaffInformation> getStaffInformations() {
		return this.staffInformations;
	}

	public void setStaffInformations(List<StaffInformation> staffInformations) {
		this.staffInformations = staffInformations;
	}

	public StaffInformation addStaffInformation(StaffInformation staffInformation) {
		getStaffInformations().add(staffInformation);
		staffInformation.setSocialRelation(this);

		return staffInformation;
	}

	public StaffInformation removeStaffInformation(StaffInformation staffInformation) {
		getStaffInformations().remove(staffInformation);
		staffInformation.setSocialRelation(null);

		return staffInformation;
	}

}